Conventionally, computer programs for handling data in a database are formatted so as to be sequentially executed regardless of language format. In other words, the respective instructions described in such computer programs have to be executed in a described order.
For example, FIG. 6 illustrates an example of a general program for accessing a database. In FIG. 6, reference numerals 11 and 12 denote two schema definitions existing in the database. A schema definition is a description defining a data structure and, for example, defines a plurality of data items and a table (chart) made up of the data items. In the example illustrated in FIG. 6, a schema definition 11 defines a table A and a schema definition 12 defines a table B.
Reference numeral 13 denotes a database management system, 14 a database, and 15 a sequential database access program. According to schema definitions 11 and 12, the database management system 13 receives an access instruction from the database access program 15 and performs data processing on the database 14.
Reference numerals 151 to 1510 denoting described contents of the database access program 15 represent a description example of access instructions for the database. Reference numeral 151 denotes an instruction to substitute a value 1234 into A1. Reference numeral 152 denotes an instruction to add 5 to the value of A1 and substitute the sum into A4. Reference numeral 153 denotes an instruction to subtract 1 from the value of A4 and substitute the difference into A3. Reference numeral 154 denotes an instruction to add up the values of A3 and A4 and substitute the sum into A2.
Reference numeral 155 denotes an insert statement, a SQL statement that is a statement for accessing the database. The insert statement is an instruction to newly store a value in the database 14. In this example, reference numeral 155 denotes an instruction to store data of A1, A2, A3, and A4 in the table A.
Reference numeral 156 denotes an instruction to substitute a value of A1 into B1. Reference numeral 157 denotes an instruction to substitute a summation of values of A2 of all records in the table A into B4. Reference numeral 158 denotes an instruction to add 3 to B4 and substitute the sum into B3. Reference numeral 159 denotes an instruction to multiply B3 by 2 and substitute the product into B2. Reference numeral 1510 denotes an instruction by an insert statement to store data of B1, B2, B3, and B4 in the table B.
With such a sequential database access program 15, interchanging the sequence of instructions from 151 to 1510 results in changes in values to be stored in the database 14. For example, if the sequence of 152 and 153 is inversely described and executed, since A3 is computed before a value is substituted into A4, the value of A3 ends up being different from when 152 and 153 are not interchanged. This means that whenever a programmer writes a program, the program must be written with utmost case for the sequence in which instructions are described.
Meanwhile, prior methods of reducing the effort expended by a programmer to write a database access program include the methods described below (refer to Non-Patent Document 1). As a first method, as many as possible of instructions which are normally described in a program by a programmer are incorporated into functions of a database management system. For example, by defining a computation between data items in a view description of the database, a description of an instruction to perform the computation can be eliminated from the database access program.
In this case, a view description refers to a description to provide an appearance of a single virtual table by, for example, selecting and deriving desired data from one or a plurality of tables. Since the view description is a virtual table description, unlike a real table, the description itself does not contain data.
Another method is to equip the database management system with a trigger function. A trigger function is a function in which processing such as updating performed on a table triggers processing such as updating on another table. Using the trigger function, in a plurality of database access programs that access the same database, processing normally described at a plurality of locations can now be described integrated at a single location. Accordingly, a reduction in a description length of database access programs has been achieved.
Moreover, an automatic conversion system that enables a database to use a utilization program of another database by automatically modifying table names, item names, and the like of the program is disclosed in Patent Document 1. Furthermore, a technique for converting data by using open, close, name change (rename), production (create), delete, or the like as a trigger is disclosed in Patent Document 2.    Non-Patent Document 1: Masashi Tsuchida, Takashi Kodera: “SQL 2003 Handbook”, Soft Research Center Inc., 2004    Patent Document 1: Japanese Patent Application Laid-open No. H6-149636    Patent Document 2: Japanese Patent Application Laid-open No. 2003-177948
However, there have been no significant changes in the description method of programs for accessing a database and data processing is still performed in the sequence of instructions in programs written by users such as programmers. Therefore, the same situation exists in that a user must create a database access program while being conscious of the sequence in which instructions are described.
Furthermore, in addition to the sequence in which instructions are described, the user must write the database access program while also paying attention to the interrelation of all data items.
Moreover, the user must redundantly describe an instruction for computing the same data item for each database access program. This problematically results in an increase in the program description length.